let c = "199999888"

console.log(c.replace(/(?!^)(?=(\d{3})+$)/g, ","))

c = "2021-11-17"
let regexp = /(\d{4})-(\d{2})-(\d{2})/
regexp.test(c)
console.log(RegExp.$1)
console.log(c.replace(regexp, "$2/$3/$1"))

console.log("2000-07-12".match(/(\d{4})([-|\/|\.])(\d{2})\2(\d{2})/g))
console.log("2000/07/12".match(/(\d{4})([-|\/|\.])(\d{2})\2(\d{2})/g))
console.log("2000.07.12".match(/(\d{4})([-|\/|\.])(\d{2})\2(\d{2})/g))

console.log("12312|abcd".replace(/^\|*/, "|").replace(/\|*$/, "|"))
console.log("|12312|abcd".replace(/^\|*/, "|").replace(/\|*$/, "|"))
console.log("12312|abcd|".replace(/^\|*/, "|").replace(/\|*$/, "|"))
console.log("|12312|abcd|".replace(/^\|*/, "|").replace(/\|*$/, "|"))
console.log("|||12312|abcd||||".replace(/^\|*/, "|").replace(/\|*$/, "|"))

const SQL = ""
// let SQL_Reg = /^[\\s]*SELECT[\\s]*+([\\*]|[[a-z][a-z]*(,[A-Z][A-Z]*)*])[\\s]*+FROM[\\s]+([A-Z][A-Z]*)[\\s]*+(WHERE[\\s]*+([A-Z][A-Z]*[=<>][^\\s]+[\\s]*(OR|AND)[\\s]*)*([A-Z][A-Z]*[=<>][^\\s]+[\\s]*)[\\s]*)*$/

const zhPunctuation /* 中文标点 */ =
  /[\u3002|\uff1f|\uff01|\uff0c|\u3001|\uff1b|\uff1a|\u201c|\u201d|\u2018|\u2019|\uff08|\uff09|\u300a|\u300b|\u3008|\u3009|\u3010|\u3011|\u300e|\u300f|\u300c|\u300d|\ufe43|\ufe44|\u3014|\u3015|\u2026|\u2014|\uff5e|\ufe4f|\uffe5]/
const zhStr /* 中文汉字 */ = /('|")[\u4e00-\u9fa5]*\1/
const KEY = new RegExp(
  /and|exec|insert|delete|update|count|\*|%|chr|mid|master|truncate|char|declare|;|or|\-|\+/
)
console.log("KEY:", KEY)
const SQLKeyWords /* 关键字 */ =
  /^(and|exec|insert|delete|update|count|\*|%|chr|mid|master|truncate|char|declare|;|or|\-|\+)\s+|\s+(and|exec|insert|delete|update|count|\*|%|chr|mid|master|truncate|char|declare|;|or|\-|\+)\s+|\s+(and|exec|insert|delete|update|count|\*|%|chr|mid|master|truncate|char|declare|;|or|\-|\+)$/

console.log(zhPunctuation.test("+"))
console.log(zhStr.test(`"我的"`))
console.log("\nSQL:")
console.log(SQLKeyWords.test(" *delete"))
console.log(SQLKeyWords.test(" select "))
console.log(SQLKeyWords.test(" *"))
console.log(SQLKeyWords.test("delete *"))
console.log(SQLKeyWords.test(" delete "))
console.log(SQLKeyWords.test(" delete"))
// console.log('delete '.match(SQLKeyWords))
// console.log(' delete '.match(SQLKeyWords))
// console.log(' delete'.match(SQLKeyWords))

// let group = /\<(a|b|c)\>.*\</\\1>/

let couldWrap =
  /\b(?![\u0020-\u002F\u003A-\u003F\u2000-\u206F\u2E00-\u2E7F\u3000-\u303F\uFF00-\uFF1F])|(?=[\u2E80-\u2FFF\u3040-\u9FFF])/g

let testStr =
  "中英文 chinese 和 english 混排的情况下，匹配可以换行的位置 position，需要特别注意全角标点，和半角标点,one apple a day keeps doctor away. "
console.log("couldWrap", testStr.match(couldWrap))
